package com.itheima.exerciseTest.test30_39;

import java.util.Arrays;
import java.util.Random;

public class Test31 {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[10];
        arr[0] = r.nextInt(100) + 1;
        int count = 1;
        while(count < 10){
            boolean boo = false;
            int tamp = r.nextInt(100) + 1;
            for (int i = 0; i < count; i++) {
                if(tamp == arr[i]){
                    boo = false;
                    break;
                }
                boo = true;
            }
            if(boo == true){
                arr[count] = tamp;
                count++;
            }
        }
        String s = Arrays.toString(arr);
        System.out.println(s);
    }
}
